home *** CD-ROM | disk | FTP | other *** search
/ The PC-SIG Library 10 / The PC-Sig Library - Shareware for the IBM PC and Compatibles (PC-SIG)(Tenth Edition Disks 1-2804)(1991).iso / PC_SIGCD / 02 / 8 / DISK0283.ZIP / INT_PORT.DOC < prev    next >
Text File  |  1985-01-29  |  2KB  |  44 lines

  1.     The program int.com is not necessarily portable between different
  2. ms-dos machines. The unportability is due to the value of EXTRA in the source.
  3. If int 1Ch was a hardware interupt, the value of EXTRA is 0. But int 1Ch is
  4. usually a software interupt invoked from the timer tick interupt handler
  5. (int 8) and thus int.com must reach deeper into the stack to find the programs
  6. cs:ip values. The value of extra can be found in two ways.
  7.     The debugger can be used to look through the interupt code that calls
  8. int 1Ch and the value of EXTRA can be guessed. There are 6 bytes for an
  9. extra interupt, 2 bytes for each push, 16 bytes for a pushall on the 186.
  10. The Tandy 2000 has int 8, a pushall, and 2 pushes in effect so
  11. 6+16+(2*2)=26 (=1Ah)    is the value of EXTRA.
  12. The IBM has int 8, and 3 pushes in effect so
  13. 6+(2*3)=12 (=0Ch)       is the value of EXTRA.
  14.  
  15. Another way is to enter the debugger and type: (The int3 should end up at 113)
  16. a100
  17. cli
  18. mov ax,0
  19. mov ds,ax
  20. mov word [70],113
  21. mov [72],cs
  22. sti
  23. jmp 111
  24. int3
  25.  
  26. r
  27. g
  28.  
  29. Now, if everything is working properly, you will have two register dumps
  30. to compare. Subtracting the SP value of the second from the first gives the
  31. number of bytes added to the stack by the interupts. Subtract 6 from this
  32. value to get the value EXTRA should have. (Be sure to do the arithmetic
  33. carefully, The SP values are in hex). By the way, your machine will need
  34. to be rebooted now.
  35. Example:
  36. For the Tandy 2000 the SP=FFEE and FFCE. (hex)
  37. EEh-CEh=20h, 20h-6=1Ah and the value for EXTRA is 1Ah
  38. For the IBM the SP=FFEE and FFDC. (hex)
  39. EEh-DCh=12h, 12h-6=0Ch and the value for EXTRA is 0Ch
  40.  
  41. Note that int.com only interupts a program when the cs:ip values are
  42. larger than the end of the int.com code and smaller than C0000 (hex).
  43. I don't know whether this is appropriate for all ms-dos machines.
  44.